# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=lastpass-cli
pkgver=1.3.3
pkgrel=3
pkgdesc="LastPass command line interface tool"
url="https://lastpass.com"
arch="all"
license="GPL-2.0-or-later"
makedepends="asciidoc bash cmake curl-dev openssl1.1-compat-dev libxml2-dev"
subpackages="$pkgname-doc
	$pkgname-zsh-completion
	$pkgname-bash-completion
	$pkgname-fish-completion
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/lastpass/lastpass-cli/archive/v$pkgver.tar.gz
	e3311cebdb29a3267843cf656a32f01c5062897e.patch
	"

build() {
	make all
}

check() {
	make test
}

package() {
	make DESTDIR="$pkgdir" install install-doc

	install -D -m644 "$builddir"/contrib/lpass_zsh_completion \
		"$pkgdir"/usr/share/zsh/site-functions/_$pkgname

	install -D -m644 "$builddir"/contrib/lpass_bash_completion \
		"$pkgdir"/usr/share/bash-completion/completions/$pkgname.bash

	install -D -m644 "$builddir"/contrib/completions-lpass.fish \
		"$pkgdir"/usr/share/fish/completions/$pkgname.fish
}

sha512sums="9b9274cae1fe4045b7df4402170c522ab5765929739e76141b35a75ce3c8af824acd881e194face45e8721d6ce778bde97ff1a1ac23515de0c6dba28d61a8c7e  lastpass-cli-1.3.3.tar.gz
0f624e6b83d7d193089b2b13d03f261dc8e9df88cafa9b295ad55a6242ef5cca65c2d8ecb3d7330034a1b3d1bfef4a76d5d07491439f0360ac285cba4f050de5  e3311cebdb29a3267843cf656a32f01c5062897e.patch"
